﻿<%@ Page Title="" Language="C#" MasterPageFile="~/sellMain.Master" AutoEventWireup="true" CodeBehind="ajaxprotextaspx.aspx.cs" Inherits="Newsell.ajaxprotextaspx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

        <script type="text/javascript" language="javascript">
            function LookUpStock() {
                debugger;
                var stockListBox = document.getElementById('<%=TextBox1.ClientID%>');
                if (stockListBox.value!= "")
                {
                  var stock = stockListBox.value;      
                  // 执行客户端回调以便将数据传送给服务器网页。
                  CallServer(stock, "");
                }
                else
                {
                  document.getElementById("<%=TextBox1.ClientID %>").value = "请先选取一项股票。";
                }
            }
            // 接收回调所传回的结果，请注意此名称与 GetCallbackEventReference 方法中所指派的相同。
            function ReceiveServerData(retrunValue, context) {
                debugger;
                document.getElementById("va").innerHTML = retrunValue;
            }
        </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContentPlaceHolder" runat="server">

    <div id="va" style="width:500px; height:300px; background:#eef78e;"></div>
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <input id="Button3" type="button" value="回调事件" onclick="LookUpStock();" />

</asp:Content>
